Fix id_param in shallow routes

This fix the id_param method to return a nil when the params hash returns nil, and the string of the value otherwise. It fixed the Issue #861.