Fix various issues. More flexibility.