Fix some stupid bugs