fixes for paperclip 4