Improvements

Improvements from @marcbachmann