Various cleanups and fixes due to feedback