Various bug fixes for move generation.