litle changes

- add preprocessor conditions to disable advanced functionallity,
if not needed
- change code to reduce warnings