java 5/6 support, bug fixes