Added return values to functions
Fixed release build