Made removal and disposal of services type safe (got InvalidCastException)