Fix several bugs in basic functionality
Fix setup file