Fixes to logic and output