Fixed pawn promotion issues and typeerror.