Fixed a few issues with the java BinaryWriter