Added resolve parameters and cast to int helper plus tests.