added icing tests and fixed a bug that could cause a runtime panic"