Fixed several little and trivial bugs..