Fixed rest of bugs, NullPointer etc