Improved security for utility methods, fixed some test failures