pull-request-247

Tomas, Can you review this? I'm not sure what kinds of issues it may cause.