Some bug fixes + display function for cp