Fix terrible bugs