fixed compilation, not tested though