Fixed some more warnings/bugs