Replaced eval() with safer ast.literal_eval()

Plus fixed error message when creating new view.