Add code fixes to let program run as intended