Repackage and clean up, also fixes #2