fixed bugs on loading defaults, added tests