Fixes from initial (messy) commit