fixes some issues with -k and -s