Bug fixes. This is a working build