Fix shims

Hi tokuhirom,

This is the stuff I was talking about earlier. Find me on irc if you want to discuss.