Fixed an issue when no appropriate solver is available (closes #151). Also some minor refactoring.