Cleanups and sync with #138