Improve/Perfect POSIX compliance

These commits should provide full POSIX compliance (to my knowledge, please comment).

Additionally, it also asks bash to conform to POSIX when using this script.