Fixed smaller bugs