Fixed 'function' check.
Optimized source in error message and fixed bug in object test.
Differentiate between normale function and class in check.