Prevent traceback using refresh param

This commit forces the 'refresh' param to be cast as a string to keep
things like 'refresh: 123' in a pkg state from causing a TypeError.