Replaced tabs with spaces in core and fixed some TODOs