Fix #27 and be more careful when getting dict content