Fix bug in inspect
implementation and add a test
#422
Merged
inspect
implementation and add a test
#422