General fixes and minor features