remove executable bit
add patch from ticket #1103, consistency fixes, remove some unneeded bashisms, set proper JAVA_HOME on OSX