Fix some bugs

This might fix what you wanted