Fixed can() warnings

 * Fixed 'can() used as function' warning that sometimes happens
 * Fixed brocken magic.t unit test