Some fixes and minor features