Fix some more bugs