Fixed bug where default wasn't set correctly, added count to logs, some code cleanup

Change-Id: Ifcf7d205c979c34d89fbbe149441ea15ef3045f6