fixed various bugs from last commit