fixed some more bugs introduced while merging

hopefully everything is working now