Errors Using the Diamond Square Algorithm

Hello, I have been working on making random maps and am having a problem with my code. I decided to put the diamond step in a try and catch so if its doing a point next to the edge it will switch to doing 3 known points. Its not working for some reason and I’m not grasping why. Its when I use map[x - midX][y] thats the problem. If I take out the try catch and just use all the alternative ones it works but has some artifacts. I got some code and pictures. Also I wonder why the stupid thing only has water coming from the left in every one I open. Any help will be much appreciated.

http://pastebin.java-gaming.org/d3d42676f69

This what it looks like using 3 points

What happens when I add a fourth