Fixed several errors and added cabal build