Use array_get to get current class

PHP throws a warning for undefined index:class when no classes are passed.
Merge pull request #7 from sahanz/patch-1

Use array_get to get current class