Added inspect, fixed a few bugs