Improved Metrics and fixed type issue