Many fixes, added Utils to replace Java utils.