The stability of boundary layers on curved surfaces and surfaces involving abrupt changes