Fix BwapiGame bugs and some memory management bugs as well

Signed-off-by: MHesham <mhesham.fcis@gmail.com>