Multiple clean-ups + fixes #1