added tests for proper loading; fixed a bug found during the process