Repair package imports and some formatting