Initialization Fix

Fixed initialization bug, other slight code changes