Fixed bugs and added types for object fields