Added initial mocl support and fixed undefined condition