Fixed empty stacktrace info and added a check to prevent an exception from being thrown when a method in the stack has no declaring type (i.e a lambda expression)