fixed bugs to make package compile