Fixes and small improvements