Fix indentation and callback behaviour