couple small bug fixes, still not completely done