Fixed up some bugs and added an install phase