Fixed to work with arduino and also fixed examples