fixed bugs (addresses #53)