Fix some problems with building