fixed bug for keys containing ':' and added __str__