Refactored addGettersSetters function; Misc. bug fixes