Bugfix in load function