Fix some weird bugs