Fixed batch of bugs