Merge pull request #431 from Kratos714/master

Fixed some minor memory issues