Merged pull-request with Przemek's final changes