fixes in issue 31
Merge pull request #210 from smogon/6061b78150de3bc346b27e5a99383d77

fixes in issue 31