FIX: Check the err argument and check if "window" is truly, return a proper Error object accordingly.

Close #31.