fixing 'undefined' bug

Checked some files for x = x || value and changed to defaultValue()