Fixes and guards added