Bugs Fixed from last commit

4af0ace0a157c586e119faf053301c4624e15c37