fixed memory leak cleaned up typedefs and error checks
Merge branch 'master' of https://github.com/ty1824/crush